/*
 * @(#)ConfigContextInit.java 1.0 2019年10月29日下午2:55:07
 *
 * Saturn Framework Co.Limt
 * Copyright (c) 2012-2019 tanks, Inc. All rights reserved.
 */
package com.saturn.cloud.config.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;

/**
 * <dl>
 *    <dt><b>Title:</b></dt>
 *    <dd>
 *    	none
 *    </dd>
 *    <dt><b>Description:</b></dt>
 *    <dd>
 *    	<p>none
 *    </dd>
 * </dl>
 *
 * @author tanks
 * @version 1.0, 2019年10月29日
 * @since satrun-config-spring-cloud-starter
 * 
 */
public class ConfigContextInit  implements ApplicationListener<ApplicationReadyEvent> {

	protected final Log logger = LogFactory.getLog(getClass());
	 
	@Override
	public void onApplicationEvent(ApplicationReadyEvent event) {
		ConfigContext.init();
		ConfigContext.setApplicationContext(event.getApplicationContext());
	}

}